<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>Dashboard {if condition="$Think.config.SITE_NAME"}-{$Think.config.SITE_NAME}{/if}</title>

    <meta name="description" content="User login page"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="__PUBLIC__/ace/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/ace/font-awesome/4.5.0/css/font-awesome.min.css"/>

    <!-- text fonts -->
    <link rel="stylesheet" href="__PUBLIC__/ace/css/fonts.googleapis.com.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="__PUBLIC__/ace/css/ace.min.css"/>

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="__PUBLIC__/ace/css/ace-part2.min.css"/>
    <![endif]-->
    <link rel="stylesheet" href="__PUBLIC__/ace/css/ace-rtl.min.css"/>

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="__PUBLIC__/ace/css/ace-ie.min.css"/>
    <![endif]-->

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="__PUBLIC__/ace/js/html5shiv.min.js"></script>
    <script src="__PUBLIC__/ace/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-layout">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h1>
                            <i class="ace-icon fa fa-leaf green"></i>
                            <span class="red">Ace</span>
                            <span class="white" id="id-text2">Admin</span>
                        </h1>
                        <h4 class="blue" id="id-company-text">&copy; {$Think.config.SITE_NAME}</h4>
                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="ace-icon fa fa-coffee green"></i>
                                        登录
                                    </h4>

                                    <div class="space-6"></div>

                                    <form class="ajaxForm3" name="runlogin" id="runlogin" method="post" action="{:url('runlogin')}">
                                        <fieldset>
                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="text" class="form-control" name="username" id="username"
                                                           placeholder="输入账号"/>
                                                    <i class="ace-icon fa fa-user"></i>
                                                </span>
                                            </label>

                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="password" class="form-control" name="password" id="password"
                                                           placeholder="输入密码"/>
                                                    <i class="ace-icon fa fa-lock"></i>
                                                </span>
                                            </label>

                                            <label class="block clearfix">
												<span class="block input-icon input-icon-right">
													<input type="text" class="form-control" name="verify" id="verify"
                                                           placeholder="输入验证码" required/>
													<i class="ace-icon fa fa-sort-alpha-asc"></i>
												</span>
                                            </label>
                                            <label class="block clearfix">
												<span class="block text-center">
													<img class="verify_img" id="verify_img" src="{:url('Login/verify')}"
                                                         onClick="this.src='{:url('Login/verify')}'+'?'+Math.random()"
                                                         style="cursor: pointer;width:100%;border: 1px solid #d5d5d5;"
                                                         title="点击获取">
												</span>
                                            </label>

                                            <div class="space"></div>

                                            <div class="clearfix">
                                                <label class="inline">
                                                    <input type="checkbox" class="ace" name=""/>
                                                    <span class="lbl"> 记住密码</span>
                                                </label>

                                                <button type="submit" id="login-but" class="width-35 pull-right btn btn-sm btn-primary">
                                                    <i class="ace-icon fa fa-key"></i>
                                                    <span class="bigger-110">登录</span>
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>

                                </div><!-- /.widget-main -->

                            </div><!-- /.widget-body -->
                        </div><!-- /.login-box -->

                    </div><!-- /.position-relative -->


                </div>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.main-content -->
</div><!-- /.main-container -->

<!-- basic scripts -->

<!--[if !IE]> -->
<script src="__PUBLIC__/ace/js/jquery-2.1.4.min.js"></script>

<!-- <![endif]-->

<!--[if IE]>
<script src="__PUBLIC__/ace/js/jquery-1.11.3.min.js"></script>
<![endif]-->
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='__PUBLIC__/ace/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>

<!-- inline scripts related to this page -->
<script src="__PUBLIC__/others/jquery.form.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
    /* 通用含验证码表单不带检查操作，失败不跳转 */

    $(function () {
        $('.ajaxForm3').ajaxForm({
            success: complete3, // 这是提交后的方法
            dataType: 'json'
        });
    });

    //失败不跳转,验证码刷新
    function complete3(data) {
        if (data.code == 1) {
            layer.msg(data.msg, {icon: 6});
            window.location.href = data.url;
        } else {
            $("#verify").val('');
            $("#verify_img").click();
            layer.alert(data.msg, {icon: 5});
        }
    }
</script>
</body>
</html>